package com.xyhuo.leetcode.proxy.staticProxy;

/**
 * 代理类
 */
public class StudentsProxy implements Person {

    //被代理的学生
    Student stu;

    public StudentsProxy(Person stu) {
        if (stu.getClass() == Student.class) {
            this.stu = (Student) stu;
        }
    }

    @Override
    public void giveMoney() {
        System.out.println("张三最近学习进步！");
        stu.giveMoney();
    }
}
